package com.hangzhou.welbeing.welbeinginstrument.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.inteface.OnRecyclerViewItemClickListener;

/**
 * 时间 2017 年 08 月 27 日
 * 作者  Z2043 welbeing to hangzou com.hangzhou.welbeing.pregnant.welbeing_pregnant.adapter
 */
public class PayAttentionCircleAdapter  extends  RecyclerView.Adapter<RecyclerView.ViewHolder> implements View.OnClickListener{
    private OnRecyclerViewItemClickListener mOnItemClickListener = null;
    public void setOnItemClickListener(OnRecyclerViewItemClickListener listener) {
        this.mOnItemClickListener = listener;
    }
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_pay_attention_circle_recyclerview,parent,false);
        ViewHolder viewHolder = new ViewHolder(view);
        view.setOnClickListener(this);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return 10;
    }

    @Override
    public void onClick(View view) {
        if(mOnItemClickListener != null ){
            mOnItemClickListener.onItemClick(view);
        }
    }

    /**
     * 身体布局Holder
     */
    static class ViewHolder extends RecyclerView.ViewHolder {
        private TextView tv_titles;
        private  TextView tv_articles_content;
        private ImageView iv_articles_images;
        public ViewHolder(View itemView) {
            super(itemView);
            tv_titles =  (TextView) itemView.findViewById(R.id.item_home_page_recyclerview_tv_articles_title);
            tv_articles_content =  (TextView) itemView.findViewById(R.id.item_home_page_recyclerview_tv_articles_content);
            iv_articles_images =  (ImageView) itemView.findViewById(R.id.item_home_page_recyclerview_iv_articles_images);
        }
    }
}
